projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dba8070
)
stdio_names: Ensure MAX_NAMES is defined before use, don't use 3 directly
author
Tom Rini
<
[email protected]
>
Thu, 3 May 2018 13:12:26 +0000
(09:12 -0400)
committer
Tom Rini
<
[email protected]
>
Sun, 6 May 2018 17:35:16 +0000
(13:35 -0400)
With tighter build flags the fact that <stdio_dev.h> doesn't have a
reference back to MAX_NAMES causes an error. Include <stdio.h> here and
then in common/console.c use MAX_NAMES rather than 3 when working with
stdio_names.
Reported-by: Peter Robinson <
[email protected]
>
Signed-off-by: Tom Rini <
[email protected]
>
Tested-by: Peter Robinson <
[email protected]
>
common/console.c
patch
|
blob
|
history
include/stdio_dev.h
patch
|
blob
|
history
diff --git
a/common/console.c
b/common/console.c
index 0e0295514b21687fadced9a8827a0c7e4700eb6c..b9297e0fc4904a063ed2514e9474232ebec411ac 100644
(file)
--- a/
common/console.c
+++ b/
common/console.c
@@
-847,7
+847,7
@@
done:
#ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
/* set the environment variables (will overwrite previous env settings) */
- for (i = 0; i <
3
; i++) {
+ for (i = 0; i <
MAX_FILES
; i++) {
env_set(stdio_names[i], stdio_devices[i]->name);
}
#endif /* CONFIG_SYS_CONSOLE_ENV_OVERWRITE */
@@
-926,7
+926,7
@@
int console_init_r(void)
#endif /* CONFIG_SYS_CONSOLE_INFO_QUIET */
/* Setting environment variables */
- for (i = 0; i <
3
; i++) {
+ for (i = 0; i <
MAX_FILES
; i++) {
env_set(stdio_names[i], stdio_devices[i]->name);
}
diff --git
a/include/stdio_dev.h
b/include/stdio_dev.h
index 1ea8bff47babd751fd9b9f27511df5d9829c0174..c2a88b4fc416768400426f24d10a4f9aee3e6f31 100644
(file)
--- a/
include/stdio_dev.h
+++ b/
include/stdio_dev.h
@@
-8,6
+8,7
@@
#ifndef _STDIO_DEV_H_
#define _STDIO_DEV_H_
+#include <stdio.h>
#include <linux/list.h>
/*